<?php
require_once("lib/api.php");
require_once("lib/auth/session.php");
$api = new api();
/*
 if (isset($_POST['userid'])) {
 $userid = $_POST['userid'];
 if (!is_numeric($userid)) {
 $api->setYouFail("Needs to be a number.");
 } elseif (!($userid > 0)) {
 $api->setYouFail("Needs to be a number larger than 0.");
 } elseif (loggedIn() == $userid) {//, JSON_FORCE_OBJECT
 logout();
 $api->setOk();
 } else {
 $api->setYouFail("Not logged in.");
 }
 }
 */
if (loggedIn() == $userid) {//, JSON_FORCE_OBJECT
    logout();
    $api->setOk();
} else {
    $api->setYouFail("Not logged in.");
}
$api->returnResponse();
?>